import {Component, Output} from '@angular/core';
import {EventEmitter} from '@angular/core';

@Component({
  selector: 'app-sidebar',
  templateUrl: './sidebar.component.html',
  standalone: false,
  styleUrl: './sidebar.component.css'
})
export class SidebarComponent {
  // 控制侧边栏是否折叠
  isCollapsed: boolean = false;
  @Output() featureChanged = new EventEmitter<string>();

  // 当前激活的功能
  activeFeature: string = 'problem';

  // 可切换的功能标签
  featureTabs = [
    { id: 'problem', label: 'problem 描述' },
    { id: 'ai', label: 'AI 助手' },
    { id: 'room', label: '协作编程' },
    { id: 'video', label: '视频通话'},
    { id: 'settings', label: '设置' },
    // 未来可拓展更多功能
  ];

  toggleSidebar() {
    this.isCollapsed = !this.isCollapsed;
  }

  switchFeature(id: string) {
    this.activeFeature = id;
    this.featureChanged.emit(id);
    // 你可以通过事件发射器将当前选中的 feature 发给父组件
  }
}
